var minOperations = function (target, arr) {
    newarr = target.filter((x) => !arr.some((item) => target.indexOf(x) === item));
    console.log(newarr);
};
let res = minOperations(target = [6, 4, 8, 1, 3, 2], arr = [4, 7, 6, 2, 3, 8, 6, 1])
console.log(res);